x86/ioreq server: handle read-modify-write cases for p2m_ioreq_server pages
authorPaul Durrant <paul.durrant@citrix.com>
Fri, 7 Apr 2017 15:38:48 +0000 (17:38 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 7 Apr 2017 15:38:48 +0000 (17:38 +0200)
commit4b602cced9a2d1b83b337fcdac0b3d4a3b4ea926
treefa0b3f1c936cd682b1caed460963c5862ce93f89
parent306f16436298b35278be92757559851528e0ed46
x86/ioreq server: handle read-modify-write cases for p2m_ioreq_server pages

In ept_handle_violation(), write violations are also treated as
read violations. And when a VM is accessing a write-protected
address with read-modify-write instructions, the read emulation
process is triggered first.

For p2m_ioreq_server pages, current ioreq server only forwards
the write operations to the device model. Therefore when such page
is being accessed by a read-modify-write instruction, the read
operations should be emulated here in hypervisor. This patch provides
such a handler to copy the data to the buffer.

Note: MMIOs with p2m_mmio_dm type do not need such special treatment
because both reads and writes will go to the device mode.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Signed-off-by: Yu Zhang <yu.c.zhang@linux.intel.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/hvm/emulate.c